﻿'========================================================================
'功能:員工資料商業邏輯物件
'作者:andy
'日期: 2011/1/31
'========================================================================

Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.Data.SqlClient
Imports System.Text
Imports System.Data
Namespace WorkFlow.BBL
    Public Class WFAgntBBL




        ''' <summary>
        ''' 取得今日可以代理的人的資料
        ''' </summary>
        ''' <param name="Agent"></param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Function GetAgentUID(ByVal Agent As String, ByVal dbName As String) As DataTable
            Dim db1 As WorkFlow.DAO.WFAgentDAO = New WorkFlow.DAO.WFAgentDAO(dbName)
            Return db1.GetAgentUID(Agent)
        End Function


        ''' <summary>
        ''' 要修改代理人資料PS:自己才能修改自己的資料
        ''' </summary>
        ''' <param name="UID"></param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Function GetData(ByVal UID As String, ByVal dbName As String) As DataTable
            Dim db1 As WorkFlow.DAO.WFAgentDAO = New WorkFlow.DAO.WFAgentDAO(dbName)
            Return db1.GetData(UID)
        End Function



        Public Sub InsertData(ByVal UID As String, ByVal Agent As String, ByVal StartDate As DateTime, ByVal EndDate As DateTime, ByVal dbName As String)
            Dim db1 As WorkFlow.DAO.WFAgentDAO = New WorkFlow.DAO.WFAgentDAO(dbName)
            db1.InsertData(UID, Agent, StartDate, EndDate)
        End Sub

        Public Sub UpdateData(ByVal UID As String, ByVal SeqNo As Integer, ByVal Agent As String, ByVal StartDate As DateTime, ByVal EndDate As DateTime, ByVal Status As String, ByVal dbName As String)
            Dim db1 As WorkFlow.DAO.WFAgentDAO = New WorkFlow.DAO.WFAgentDAO(dbName)
            db1.UpdateData(UID, SeqNo, Agent, StartDate, EndDate, Status)
        End Sub

    End Class
End Namespace

